package com.zhukunri.sp04.fegin;

import com.zhukunri.sp01.domain.Item;
import com.zhukunri.sp01.web.util.JsonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient("ITEM-SERVICE")
public interface ItemClient {

    //获取订单的商品列表
    @GetMapping("/{orderId}")
    public JsonResult<List<Item>> getItems(@PathVariable("orderId") String orderId);

    //减少商品库存
    @GetMapping("/descreaseNumber")
    public JsonResult<?> descreaseNumber(@RequestBody List<Item> items);

}
